package com.kgc.scd.service;

import com.kgc.scd.bean.UserVoXZY;
import com.kgc.scd.util.RequestResult;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @program: com.kgc.scd.service
 * @author: HarryXzy
 * @create: 2022-06-10 16:01
 * @description:
 **/
@FeignClient(value = "blmall-server-xzy-8101")
public interface UserLoginRegService {

    // 生成二维码（手动模拟）
    @GetMapping("/wxauthCodeUrl")
    RequestResult<String> getWechatAuthCodeUrl();

    // 微信登陆绑定手机号码
    @GetMapping("/wxloginBindphone")
    Map<String, String> wxloginBindphone(@RequestParam("wxId") String wxId,@RequestParam("phone") String phoneNO,@RequestParam("phoneCode") String phoneCode);

    // 获取手机号验证码
    @GetMapping("/getPhoneCode")
    Map<String, String> getPhoneCode(@RequestParam("phone")String phoneNO);

    // 使用手机号快捷登陆或注册
    @PostMapping("/loginOrRigByPhone")
    Map<String, String> loginOrRigByPhone(@RequestParam("phone")String phoneNo, @RequestParam("phoneCode")String phoneCode);

    // 使用用户名或电话号进行密码登陆
    @PostMapping("/loginByUserNameAndPwd")
    Map<String, String> loginByUserNameAndPwd(@RequestParam("userNameOrPhone")String userNameOrPhone,@RequestParam("userPwd")String userPwd);

    // 普通注册
    @PostMapping("/userRegister")
    Map<String, String> userRegister(@RequestBody UserVoXZY user, @RequestParam("phoneCode") String phoneCode);

    // 退出登陆
    @PostMapping("/logout")
    Map<String, String> userLogOut(@RequestParam("token") String token);
}
